﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace db_proto
{
    class SqlService
    {
        private SqlService()
        { }


        private static SqlService service=null;

        SqlConnection conn=null;

        String connString = "server=GRZES-PC;uid=salon;pwd=salon;database=salon";

        public static SqlService getInstance()
        {
            if (service == null)
                service = new SqlService();

            return service;
        }

        public SqlConnection getConnection()
        {
            if (conn == null)
                conn = new SqlConnection(connString);

            if (conn.State == System.Data.ConnectionState.Closed)
                conn.Open();

            return conn;
        }
    }
}
